﻿@inherits AdminCompontentBase
<MForm Model="_model" @ref="Form" EnableValidation EnableI18n Class="my-3">
    <MRow Class="row-box">
        <MCol Md="6">
            <STextField @bind-Value="_model.UserName" Required
                        Label="@T("EmailChannelOptions.UserName")"
                        Hint="@T("ChannelOptions.Tips")">
            </STextField>
        </MCol>
        <MCol Md="6">
            <STextField @bind-Value="_model.Password" Required
                        Label="@T("EmailChannelOptions.Password")"
                        Type="@(!PasswordView?"password":_passwordShow ? "text" : "password")"
                        AppendIcon="@(!PasswordView?"":_passwordShow ? "mdi-eye" : "mdi-eye-off")" OnAppendClick="()=>_passwordShow = !_passwordShow">
            </STextField>
        </MCol>
        <MCol Md="6">
            <STextField @bind-Value="_model.Smtp" Required
                        Label="@T("EmailChannelOptions.Smtp")"
                        Hint="@T("ChannelOptions.Tips")">
            </STextField>
        </MCol>
        <MCol Md="6">
            <MRow>
                <MCol>
                    <div class="outlined-box-medium pt-1">
                        <MCheckbox Dense @bind-Value="_model.Ssl" Label="@T("EmailChannelOptions.Ssl")" TValue="bool" OnChange="HandleChangeAsync"></MCheckbox>
                    </div>
                </MCol>
                <MCol>
                    <STextField @bind-Value="_model.Port" Required
                                Label="@T("EmailChannelOptions.Port")">
                    </STextField>
                </MCol>
            </MRow>
        </MCol>
    </MRow>
</MForm>